<%@taglib uri="/WEB-INF/struts-html.tld"  prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<table cellpadding="1" cellspacing="1" width="100%">
    <tr class="netral2">
        <td colspan="2"><bean:message key="quiz.quiz"/></td>
    </tr>
    <tr class="form">
        <td><bean:message key="quiz.judul"/></td>
        <td>: <c:out value="${titleQuiz.nama}"/></td>
    </tr>
    <tr class="form">
        <td><bean:message key="mapel.mapel"/></td>
        <td>: <c:out value="${titleQuiz.mataPelajaran.kode}"/> - <c:out value="${titleQuiz.mataPelajaran.nama}"/></td>
    </tr>
    <tr class="form">
        <td><bean:message key="quiz.share"/></td>
        <td>: <c:out value="${titleQuiz.isShare}"/></td>
    </tr>
</table>
<table cellpadding="1" cellspacing="1" width="100%">
    <html:form action="quiz.do?action=quizCount">
        <tr class="netral2">
            <td width="100%" colspan="3"><bean:message key="quiz.soal"/> <bean:message key="quiz.quiz"/> <html:text property="count" size="2%"/> <html:hidden property="id"/><input type="button" onclick="validate_form_Count()" value="${buttonSave}"/></td>
        </tr>
    </html:form>
    <tr class="header">
        <td><bean:message key="label.no"/></td>
        <td><bean:message key="quiz.pertanyaan"/></td>
    </tr>
    <logic:notEmpty name="listQuestionAndAnswer">
        <c:set var="count" value="0"/>
        <c:set var="angka" value="0"/>
        <c:set var="huruf" value="a,b,c,d,e"/>
        <c:forEach var="listQuestionAndAnswer" items="${listQuestionAndAnswer}" varStatus="row">
            <c:if test="${(row.count) % 2 == 0}"><tr class="over"></c:if>
            <c:if test="${(row.count) % 2 != 0}"><tr class="down"></c:if>
                <c:set var="count" value="${count+1}"/>
                <c:choose>
                    <c:when test="${ count==1}">
                        <c:set var="angka" value="${angka+1}"/>
                        <td width="5%"><c:out value="${(angka)}"/></td>
                        <td align="left"><c:out value="${listQuestionAndAnswer.description}"/></td>
                    </c:when>
                    <c:otherwise>
                        <td></td>
                        <td align="left"><c:out value="${listQuestionAndAnswer.description}"/></td>
                    </c:otherwise>
                </c:choose>
                <c:if test="${count==6}">
                    <c:set var="count" value="${0}"/>
                </c:if>
            </tr>
        </c:forEach>

    </logic:notEmpty>
    <tr class="form">
        <td colspan="2">&nbsp;</td>
    </tr>
    <logic:empty name="listQuestionAndAnswer">
        <tr class="form">
            <td colspan="2" align="center"><bean:message key="quiz.soal"/> <bean:message key="label.isEmpty"/></td>
        </tr>
    </logic:empty>
</table>